# -*- coding: utf-8 -*-
import scrapy


class QidianSpider(scrapy.Spider):
    name = 'qidian'
    allowed_domains = ['qidian.com/']
    start_urls = ["https://read.qidian.com/chapter/3Q__bQt6cZEVDwQbBL_r1g2/GSlTBhSdiqP4p8iEw--PPw2"]

    def parse(self, response):
        chapter_name=response.css('.j_chapterName .content-wrap::text').extract_first()  #章节名字
        # 3.全角空格(中文符号)\u3000,中文文章中使用
        content=response.css('.read-content p::text').extract()
        article=[]
        for p in content:
            txt=p.replace(u'\u3000', '')
            article.append(txt)
        print(article)
